package com.learn.security.modules.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class WebController {

    @RequestMapping("modules/{module}/{url}.html")
    public String module(@PathVariable("module") String module, @PathVariable("url") String url){
        return "modules/" + module + "/" + url + ".html";
    }

    @RequestMapping("{url}.html")
    public String toIndex(@PathVariable("url") String url){
        return url + ".html";
    }

    @RequestMapping("/")
    public String index(){
        return "index.html";
    }

    @RequestMapping("{module}/{url}.html")
    public String modules(@PathVariable("module") String module, @PathVariable("url") String url){
        return module + "/" + url;
    }
}
